package cn.bitkit.assist.code.creator;

import cn.bitkit.assist.code.BaseCreator;
import cn.bitkit.tools.file.TextHelper;

public class DtoCreator extends BaseCreator {

    @Override
    public void create() {
        final String template = getTemplate("dto.tpl");
        TextHelper builder = TextHelper.loadString(template);
        builder.setValue("rootPkg", projectVO.getRootPkg());
        builder.setValue("modelName", projectVO.getModuleName());
        builder.setValue("entityName", entityVO.getEntityName());
        builder.setValue("importClass", getImportClass(true));
        builder.setValue("fieldList", getFieldList(true));
        String text = builder.getText();
        writeText(text, getJavaFile("pojo/dto", "DTO"));
    }

}
